#define _CRT_SECURE_NO_WARNINGS 1

#include"Heap.h"

void test_Heap()
{
	Heap hp;
	HeapInit(&hp);
	HeapPush(&hp,10);
	HeapPush(&hp,9); 
	HeapPush(&hp,8);
	HeapPush(&hp,7);
	HeapPush(&hp,6);
	HeapPush(&hp, 5); 
	HeapPush(&hp, 40);
	for (int i = 0; i < hp._size; ++i)
	{
		printf("%d ", hp._a[i]);
	}
	printf("\n");
}

void test_Sort()
{
	int a[] = {10,9,8,7,6,5,4,3,2,1};
	int size = sizeof(a) / sizeof(a[0]);
	for (int i = 0; i < size; ++i)
	{
		printf("%d ", a[i]);
	}
	printf("\n");

	HeapSort(a,size);

	for (int i = 0; i < size; ++i)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
}

int main()
{
	test_Sort();

	return 0;
}